<template>
	<div class="">
		<Header></Header>
		<div class="my_content mui-content">
			<div class="mu_login-all" id="my_login">
				<ul class="my_login">
					<li class="my_login_li">
						<span>手机号</span>
						<input type="text" v-model="phone" id="phone" placeholder="请输入旧手机号" /> 
					</li>
					<li class="my_login_li">
						<span>验证码</span>
						<input class="inp" type="text" placeholder="请输入验证码" v-model="code" @input="code"/>
						<button :class="text.class" @tap="verification">{{text.name}}</button>
						<!--<input  name="color" type="button" :value="text.name"  />-->

					</li>
				</ul>
				<div class="my_butn" @click="confirm_bind"><button class="button">确认绑定</button></div>
			</div>
		</div>
	</div>
</template>

<script>
import Header from '../../components/Header'
	export default {
	name:'edit_phone',
	data(){
		return{
			code:'',
			phone:'',
			text:{
				name:'请输入验证码',
				class:'login-num-btn'
			}
		};
	},
	created(){
		this.text;
        this.$store.commit("change_header",{
            header_text:'修改绑定手机号',
            header_right_func:true,
            header_right_html:'',
            header_back_btn:true
        })
    },
    watch:{
    	
    },
	methods:{
		onderurl:function(url,val,type){
			let that = this;
			if(type == 1){
				that.$router.push({path:url,query: { queryId:  val }});
			}else{
				that.$router.push(url);
			}
		},
		verification:function(){
			let that = this;
			that.$axios.get("api/User/checkcode",{params:{phone:that.phone}}).then(res=>{
				
			});
		},
		//提交s
		confirm_bind:function(){
			console.log(this.$store.state.account.user_info)
			
			that.$axios.post("api/User/changephone",{params:{phone:that.phone,uid:this.$store.state.account.user_info.uid}}).then(res=>{
				console.log(res)
			});

		},
		code:function(){
			
		},
	},
	mounted(){
		let that = this;
		that.phone = this.$store.state.account.user_info.phone
	},
    components:{
        Header
    }
}
</script>

<style lang="less" scoped>
@import "../../../static/pxvalue.less";
@import "../../assets/less/my/edit_phone.less";
</style>